﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Hrm.Core
{
    [Serializable]
    public class ResponseModel
    {
        public ResponseModel()
        {
            Header = new Header()
            {
                Id = 0,
                Message = "操作成功！"
            };
            Body = string.Empty;
        }

        public Header Header { get; set; }

        public string Body { get; set; }

        public void SetFailed(string message)
        {
            Header = new Header()
            {
                Id = 1,
                Message = message,
            };
        }

        public void SetSuccess(string message)
        {
            Header = new Header()
            {
                Id = 0,
                Message = message,
            };
        }
    }

    public class Header
    {
        public int Id { get; set; }

        public string Message { get; set; }
    }
}
